package com.hebeiboruan.config;

import com.hebeiboruan.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RunConfig implements CommandLineRunner {
    private UserService userService;
    @Autowired
    public void setUserService(UserService userService) {
        this.userService = userService;
    }

    @Override
    public void run(String... args) throws Exception {
        System.out.println("-------------------清理缓存-------------------");
        userService.clear();
        Thread.sleep(1000);
        System.out.println("-------------------清理完成-------------------");

    }
}
